/*
 * @Author: DUST
 * @Date: 2023-06-12 15:35:22
 * @LastEditors: DUST
 * @LastEditTime: 2023-06-12 17:28:03
 * @FilePath: \vite-project\src\utils\sysInfo.ts
 * @Description: 
 * undefined
 */
import { publicIpv4 } from "public-ip"
import { Ref, ref } from "vue";

class SysInfo {
  /**
   * @description: 客户端本机IP
   * @return {*}
   */  
  private _ip = ref<string>("");
  public get ip() : Ref<string> {
    return this._ip
  }
  
  constructor() {
    this.getMyIp()
  }

  private getMyIp = async () => {
    //
    console.log("开始获取IP");
    this._ip.value = await publicIpv4();
    console.log("IP:", this._ip.value);
    console.log("结束获取IP");
  }
}

export default SysInfo;